From 5a42464547a06a080f532044a35683f82fe67f2e Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 26 May 2011 01:01:44 +0200 Subject: [PATCH] css: Rename function to _gtk_style_property_parse_value() ... and take an optional style property as argument. This way, we can allow custom parse functions for properties. The style property needs to be optional so that we can use it for widget style properties, too. --- gtk/gtkcssprovider.c | 14 ++++++++------ gtk/gtkstyleproperty.c | 7 ++++--- gtk/gtkstylepropertyprivate.h | 7 ++++--- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index 1b3c12e062..5d35797f3e 100644 --- a/gtk/gtkcssprovider.c +++ b/gtk/gtkcssprovider.c @@ -1371,9 +1371,10 @@ gtk_css_provider_get_style_property (GtkStyleProvider *provider, gtk_css_provider_parser_error, provider); - found = _gtk_css_value_parse (value, - parser, - NULL); + found = _gtk_style_property_parse_value (NULL, + value, + parser, + NULL); _gtk_css_parser_free (parser); @@ -2122,9 +2123,10 @@ parse_declaration (GtkCssScanner *scanner, } else { - if (_gtk_css_value_parse (val, - scanner->parser, - gtk_css_scanner_get_base_url (scanner))) + if (_gtk_style_property_parse_value (property, + val, + scanner->parser, + gtk_css_scanner_get_base_url (scanner))) { if (_gtk_css_parser_begins_with (scanner->parser, ';') || _gtk_css_parser_begins_with (scanner->parser, '}') || diff --git a/gtk/gtkstyleproperty.c b/gtk/gtkstyleproperty.c index 9771eb5eba..7a0003d4f5 100644 --- a/gtk/gtkstyleproperty.c +++ b/gtk/gtkstyleproperty.c @@ -1375,9 +1375,10 @@ css_string_funcs_init (void) } gboolean -_gtk_css_value_parse (GValue *value, - GtkCssParser *parser, - GFile *base) +_gtk_style_property_parse_value (const GtkStyleProperty *property, + GValue *value, + GtkCssParser *parser, + GFile *base) { ParseFunc func; diff --git a/gtk/gtkstylepropertyprivate.h b/gtk/gtkstylepropertyprivate.h index ba9fd3f4b3..2fa772be3f 100644 --- a/gtk/gtkstylepropertyprivate.h +++ b/gtk/gtkstylepropertyprivate.h @@ -56,9 +56,10 @@ void _gtk_style_property_pack (const GtkStyleProper GtkStateFlags state, GValue *value); -gboolean _gtk_css_value_parse (GValue *value, - GtkCssParser *parser, - GFile *base); +gboolean _gtk_style_property_parse_value (const GtkStyleProperty *property, + GValue *value, + GtkCssParser *parser, + GFile *base); void _gtk_style_property_print_value (const GtkStyleProperty *property, const GValue *value, GString *string); -- 2.30.2